<?php
	@session_start();
	require_once('connect.php');
	class Signup
	{
		private $userId_;
		private $email_;
		private $password_;
		private $firstName_;
		private $lastName_;
		
		
		function getUserId()
		{
			return $this->userId_;	
		}		
		
		function getEmail()
		{
			return $this->email_;	
		}
		
		function getPassword()
		{
			return $this->password_;	
		}
		
		function getFirstName()
		{
			return $this->firstName_;	
		}
		
		function getLastName()
		{
			return $this->lastName_;	
		}
		
		
		function setUserId($userId)
		{
			$this->userId_=$userId;
		}
		
		function setEmail($email)
		{
			$this->email_=$email;	
		}
		
		function setPassword($password)
		{
			$this->password_=$password;
		}
		
		function setFirstName($firstName)
		{
			$this->firstName_;	
		}
		
		function setLastName($lastName)
		{
			$this->lastName_;	
		}
		
		
		function loginUser($userEmail, $password)
		{
			$query="SELECT * FROM svg_user_login WHERE user_email='".$userEmail."' AND user_password='".$password."'";
			$result=mysql_query($query);
			if(mysql_num_rows($result)==1)
			{
				$row=mysql_fetch_array($result,MYSQL_ASSOC);
				$_SESSION['userId']	= $row['user_id'];
				$_SESSION['ipAddress'] = $_SERVER['REMOTE_ADDR'];
				return $row['user_id'];
			}
			else
				return false;	
		}
	}
?>